#include <stdio.h>
void main()
{
	long m, n;
	scanf_s("%ld %ld", &m, &n);
	for (int i = m; i < n; i++) {
		int a = i / 100;
		int b =( i % 100) / 10;
		int c = i % 10;
		if (a * a * a + b * b * b + c * c * c == i) {
			printf("%d\n", i);
		}
	}
}